<include file="All:head" />
<body>
 
<div class="app-cam">
        <div class="cam"><img src="__PUBLIC__/images/cam.png" class="img-responsive" alt="" /></div>
        <form id="registerFrm" >
                <input type="text" name="mobile" class="text" placeholder="{$Think.lang.defaultUser}" id="username" >
                <input type="text" name="nickname" class="text" placeholder="{$Think.lang.nickname}" id="nickname" >
                <input type="password" name="password" class="text" placeholder="{$Think.lang.defaultPass}" id="password" >
                <input type="password" name="password2" placeholder="{$Think.lang.password2}" id="password2" >
                  <label id="errmsg"></label>
                <div class="submit"><input type="submit" value="{$Think.lang.registerbtn}" ></div>
                <div class="clear"></div>
                <div class="new">
                        <p><a href="javascript:history.go(-1)">{$Think.lang.backToLogin}</a></p>
                        <div class="clear"></div>
                </div>
        </form>
</div>
</body>
<include file="All:boot-footer" />

<script>
    
$("#loginFrm").validator({
            message : {
                required: "请输入{0}" , 
                username:"用户名不合法" , 
                password : "",
                password2 : "",
                nickname  : "",
                
            },
            fields : {
                username : 'required ; username' , 
                password : 'required ; '
            },
            
            valid : function(form){
                $.post("./dologin" , $(form).serialize() , function(data){
                    console.log(data) ; 
                    if(data.status == 0){
                        $("#errmsg").text(data.msg);
                    }else if(data.status == 1){
                        window.location.href = SITE + 'user/index' ; 
                    }  
                } , 'json');
            }
        
});
</script>
</html>